from cleo.commands.command import Command
from cleo.io.outputs.output import Verbosity


class BaseCommand(Command):
    @classmethod
    def set_name(cls, val):
        cls.name = val

    def blue_text(self, msg):
        """show text with blue color"""
        self.add_style("w", fg="white")
        self.line(f"<info>{str(msg)}<w>")

    def green_text(self, msg):
        """show text with green color"""
        self.add_style("w", fg="white")
        self.line(f"<comment>{str(msg)}<w>")

    def red_text(self, msg):
        """show text with red color"""
        self.add_style("w", fg="white")
        self.line(f"<error>{str(msg)}<w>")

    def highlight_text(self, msg):
        """show text with yellow background, red foreground"""
        self.add_style("w", fg="white")
        self.add_style("fire", fg="red", bg="yellow", options=["bold", "blink"])
        self.line(f"<fire>{str(msg)}<w>")

    def line_debug(self, msg):
        """show debug"""
        self.line(str(msg), verbosity=Verbosity.DEBUG)

    def raw_text(self, msg):
        self.add_style("w", fg="white")
        self.line(f"<w>{str(msg)}<w>")
